package com.link2room.quintesson.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 飞猪价格计划酒店价格计划对照
 * Created by sss on 2016/8/25.
 */
@Entity
@Table(name = "taobao_xrateplan_hotel", catalog = "")
@DynamicInsert
public class TaobaoXrateplanHotel extends BaseEntity{
    public enum L2RRateplanHotel_{
        rpCode,hotelRpCode
    }

    /**
     * 价格计划代码
     */

    private String rpCode;
    /**
     * 酒店价格计划代码
     */
    private String hotelRpCode;
    private Long rpid;
    private Long status;
    private Long matchStatus;
    private String matchInfo;

    @Basic
    @Column(name = "rpid", nullable = true)
    public Long getRpid() {
        return rpid;
    }

    public void setRpid(Long rpid) {
        this.rpid = rpid;
    }

    @Basic
    @Column(name = "rp_code", nullable = false, length = 32)
    public String getRpCode() {
        return rpCode;
    }

    public void setRpCode(String rpCode) {
        this.rpCode = rpCode;
    }

    @Basic
    @Column(name = "hotel_rp_code", nullable = false, length = 32)
    public String getHotelRpCode() {
        return hotelRpCode;
    }

    public void setHotelRpCode(String hotelRpCode) {
        this.hotelRpCode = hotelRpCode;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public Long getStatus() {
        return status;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    @Basic
    @Column(name = "match_status", nullable = true)
    public Long getMatchStatus() {
        return matchStatus;
    }

    public void setMatchStatus(Long matchStatus) {
        this.matchStatus = matchStatus;
    }

    @Basic
    @Column(name = "match_info", nullable = true, length = 10)
    public String getMatchInfo() {
        return matchInfo;
    }

    public void setMatchInfo(String matchInfo) {
        this.matchInfo = matchInfo;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TaobaoXrateplanHotel that = (TaobaoXrateplanHotel) o;

        if (rpCode != null ? !rpCode.equals(that.rpCode) : that.rpCode != null) return false;
        if (hotelRpCode != null ? !hotelRpCode.equals(that.hotelRpCode) : that.hotelRpCode != null) return false;
        if (rpid != null ? !rpid.equals(that.rpid) : that.rpid != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (matchStatus != null ? !matchStatus.equals(that.matchStatus) : that.matchStatus != null) return false;
        return matchInfo != null ? matchInfo.equals(that.matchInfo) : that.matchInfo == null;

    }

    @Override
    public int hashCode() {
        int result = rpCode != null ? rpCode.hashCode() : 0;
        result = 31 * result + (hotelRpCode != null ? hotelRpCode.hashCode() : 0);
        result = 31 * result + (rpid != null ? rpid.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (matchStatus != null ? matchStatus.hashCode() : 0);
        result = 31 * result + (matchInfo != null ? matchInfo.hashCode() : 0);
        return result;
    }
}
